﻿<Window x:Class="ThunderStorm.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="ThunderStorm - Own the Web (developed by Kiran SP)" Height="800" Width="600" ResizeMode="CanResizeWithGrip" WindowStartupLocation="CenterScreen" WindowState="Maximized" WindowStyle="ThreeDBorderWindow">
        <Window.Resources>
            <Style  TargetType="{x:Type TabControl}">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type TabControl}">
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="*"/>
                                </Grid.RowDefinitions>
                                <TabPanel 
             Grid.Row="0"
             Panel.ZIndex="1" 
             Margin="0,0,4,-1" 
             IsItemsHost="True"
             Background="Transparent" />
                                <Border 
             Grid.Row="1"
             BorderBrush="Black" 
             BorderThickness="1" 
             CornerRadius="0, 12, 12, 12" >
                                    <Border.Background>
                                        <LinearGradientBrush>
                                            <GradientStop Color="CornflowerBlue" Offset="0" />
                                            <GradientStop Color="White" Offset="1" />
                                        </LinearGradientBrush>
                                    </Border.Background>
                                    <ContentPresenter ContentSource="SelectedContent" />
                                </Border>
                            </Grid>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <Style x:Key="TabStyle" TargetType="{x:Type TabItem}">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type TabItem}">
                            <Grid>
                                <Border 
             Name="Border"
             Background="LightBlue"
             BorderBrush="Black" 
             BorderThickness="1,1,1,1" 
             CornerRadius="6,6,0,0" >
                                    <ContentPresenter x:Name="ContentSite"
               VerticalAlignment="Center"
               HorizontalAlignment="Center"
               ContentSource="Header"
               Margin="12,2,12,2"/>
                                </Border>
                            </Grid>
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsSelected" Value="True">
                                    <Setter TargetName="Border" Property="Background" Value="CornflowerBlue" />
                                </Trigger>
                                <Trigger Property="IsSelected" Value="False">
                                    <Setter TargetName="Border" Property="Background" Value="LightGray" />
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <Style x:Key="AddTabStyle" TargetType="{x:Type TabItem}">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type TabItem}">
                            <Grid>
                                <Path Canvas.Left="15" Canvas.Top="50" Stroke="CornflowerBlue"
       Data="M 0,0 L 15,0 L 0,0 L 3,12 L 3, 12 L 25, 12 L 24, 12 L 20,0">
                                    <Path.Fill>
                                        <LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
                                            <GradientStop Offset="0" Color="CornflowerBlue" />
                                            <GradientStop Offset="1" Color="white" />
                                        </LinearGradientBrush>
                                    </Path.Fill>
                                </Path>
                            </Grid>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <Style x:Key="CloseImageStyle" TargetType="{x:Type Image}">
                <Setter Property="Source" Value="/ThunderStorm;component/Images/close.bmp" />
                <Style.Triggers>
                    <Trigger Property="IsMouseOver" Value="True">
                        <Setter Property="Source" Value="/ThunderStorm;component/Images/closehover.bmp"/>
                    </Trigger>
                </Style.Triggers>
            </Style>
        </Window.Resources>
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <DockPanel Height="25" VerticalAlignment="Top" Width="Auto" HorizontalAlignment="Stretch" Margin="5,5,0,0" Name="urlPanel"  Grid.Row="0" Grid.Column="0" >
                <Button VerticalAlignment="Bottom" HorizontalAlignment="left" Width="42" Margin="10,0,0,0" Name="prevbtn" Click="prevbtn_Click">
                    <Image VerticalAlignment="Top" HorizontalAlignment="center" Source="/ThunderStorm;component/Images/prev.png" Width="32" Height="16" Margin="1,0,0,0" />
                </Button>
                <Button VerticalAlignment="Bottom" HorizontalAlignment="left" Width="42" Margin="10,0,0,0" Name="nextbtn" Click="nextbtn_Click">
                    <Image VerticalAlignment="Top" HorizontalAlignment="center" Source="/ThunderStorm;component/Images/next.png" Width="32" Height="16" Margin="1,0,0,0"/>
                </Button>
                <Button VerticalAlignment="Bottom" HorizontalAlignment="left" Width="42" Margin="10,0,0,0" Name="refreshbtn" Click="refreshbtn_Click">
                    <Image VerticalAlignment="Top" HorizontalAlignment="center" Source="/ThunderStorm;component/Images/refresh.png" Width="32" Height="16" Margin="1,0,0,0"/>
                </Button>
                <TextBox Height="23" Name="urlbox" Width="296" Margin="10,0,0,0" SpellCheck.IsEnabled="True" Language="en-US" FontFamily="Times New Roman" KeyDown="urlbox_KeyDown">
                </TextBox>
                <Button VerticalAlignment="Bottom" HorizontalAlignment="left" Width="26" Margin="10,0,0,0" Name="bookmarkbtn" Click="bookmarkbtn_Click">
                    <Image VerticalAlignment="Top" HorizontalAlignment="center" Source="/ThunderStorm;component/Images/bookmark.png" Width="38" Height="17" Margin="0,0,1,2" />
                </Button>
                <Popup Name="Popup1" Width="240" Height="200" PlacementTarget="{Binding ElementName = bookmarkbtn}" Placement="Bottom" IsEnabled="True" IsOpen="False" >
                    <Border BorderBrush="white" BorderThickness="3">
                        <StackPanel Background="CornflowerBlue" VerticalAlignment="Center" Height="200">
                            <StackPanel>
                                <Grid Margin="10,10,10,20" >
                                    <Grid.RowDefinitions >
                                        <RowDefinition Height="45"></RowDefinition>
                                        <RowDefinition Height="45"></RowDefinition>
                                        <RowDefinition Height="30"></RowDefinition>
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="80"></ColumnDefinition>
                                        <ColumnDefinition Width="120"></ColumnDefinition>
                                        <ColumnDefinition Width="100"></ColumnDefinition>
                                    </Grid.ColumnDefinitions>

                                    <Label Name="bNamelbl" Content="Name:" Grid.Row="1" Grid.Column="0" HorizontalAlignment="Right" VerticalAlignment="Center"/>
                                    <TextBox Name="bName" Width="200" Height="20" Grid.Row="1" Grid.Column="1" HorizontalAlignment="Left" IsEnabled="True"/>
                                    <Label Name="bUrllbl" Content="Url:" HorizontalAlignment="Right" Grid.Row="0" Grid.Column="0" VerticalAlignment="Center" />
                                    <TextBox Name="bUrl" Width="200" Height="20" Grid.Row="0" Grid.Column="1" HorizontalAlignment="Left"/>
                                    <Button Content="Submit" Name="popupsubmit" Width="70" Height="30" Grid.Row="2" Grid.Column="0" HorizontalAlignment="Right" Click="popupsubmit_Click" />
                                    <Button Content="Cancel" Name="popupcancel" Width="70" Height="30" Grid.Row="2" Grid.Column="1" HorizontalAlignment="Left" Click="popupcancel_Click" />
                                </Grid>
                            </StackPanel>
                        </StackPanel>
                    </Border>
                </Popup>
                <Button VerticalAlignment="Bottom" HorizontalAlignment="left" Width="42" Margin="10,0,0,0" Name="gobtn" Content="Go" Click="gobtn_Click" />
                <Menu Name="booksmarksmenu" HorizontalAlignment="right" Margin="30,0,0,0">
                    <MenuItem Header="Bookmarks">
                    </MenuItem>
                </Menu>
            </DockPanel>
            <DockPanel LastChildFill="True" Width="Auto" HorizontalAlignment="Stretch" Height="Auto" VerticalAlignment="Stretch" Margin="0,5,0,0" Name="tabPanel" Grid.Row="1" Grid.Column="0" >
                <TabControl DockPanel.Dock="Top" Name="tabControl1" ItemsSource="{Binding}" DataContext="{Binding}">
                    <TabItem Name="TabItem_0" Style="{StaticResource TabStyle}">
                        <TabItem.Header>
                            <DockPanel Height="25" HorizontalAlignment="Left" Margin="0,0,0,0" Name="tabHeaderPanel" VerticalAlignment="Top" Width="150">
                                <Label Content="New tab" Height="25" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="0,0,0,0" Name="tabLabel" FontSize="12" VerticalContentAlignment="Top" />
                                <!--<Image Height="16" VerticalAlignment="Center" HorizontalAlignment="right" Margin="0,0,0,0" Name="tabCloseBtn" Stretch="Fill" Width="17" Source="/ThunderStorm;component/Images/close.bmp" MouseEnter="tabCloseBtn_MouseEnter" MouseLeave="tabCloseBtn_MouseLeave" />-->
                                <Button VerticalAlignment="Center" HorizontalAlignment="right" Width="20" Height="20" Margin="0,0,0,0" Padding="0" Name="tabCloseButton_0" Click="CloseButtonClick">
                                    <Image Height="16" VerticalAlignment="Center" HorizontalAlignment="right" Margin="0,0,0,0" Name="tabCloseImage" Stretch="Fill" Width="16">
                                        <Image.Style>
                                            <Style TargetType="{x:Type Image}">
                                                <Setter Property="Source" Value="/ThunderStorm;component/Images/close.bmp" />
                                                <Style.Triggers>
                                                    <Trigger Property="IsMouseOver" Value="True">
                                                        <Setter Property="Source" Value="/ThunderStorm;component/Images/closehover.bmp"/>
                                                    </Trigger>
                                                </Style.Triggers>
                                            </Style>
                                        </Image.Style>
                                    </Image>
                                </Button>
                            </DockPanel>
                        </TabItem.Header>
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*" />
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*" />
                            </Grid.ColumnDefinitions>
                            <DockPanel LastChildFill="True" Width="Auto" HorizontalAlignment="Stretch" Height="Auto" VerticalAlignment="Stretch" Margin="0,0,0,0" Name="contentPanel" Grid.Row="0" Grid.Column="0" >
                            </DockPanel>
                        </Grid>
                    </TabItem>
                    <TabItem Name="addTab" Margin="5,10,0,5" Style="{StaticResource AddTabStyle}">
                        <TabItem.Header>
                            <DockPanel Height="20" HorizontalAlignment="Left" Margin="0,0,0,0" Name="addPanel" VerticalAlignment="Top" Width="50" ></DockPanel>
                        </TabItem.Header>
                    </TabItem>
                </TabControl>
            </DockPanel>
        </Grid>
    </Window>
